package net.wofly.sale.stock.util;

/**
 * 出库类型
 *
 * @author lign
 * @version 1.0
 * @created 11-10月-2017 21:17:44
 */
public enum OutStockType {
    订单出库(1, "订单出库"),
    领料单(2, "领料单"),
    调拔单(3, "调拔单");
    
    private Integer value;
    private String name;
    
    private OutStockType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (OutStockType forEnum : values()) {
            if (value == forEnum.getValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (OutStockType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}